import { createRouter, createWebHashHistory } from 'vue-router'
import IndexView from '../views/IndexView.vue'
import LevelsView from '../views/LevelsView.vue'
import PlaygroundView from '../views/PlaygroundView.vue'
const router = createRouter({
  history: createWebHashHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      redirect: "/learn",
      component: IndexView,
      props: true,
    },
    {
      path: "/learn/:levelKey?",
      component: IndexView,
      props: true,
    },
    {
      path: '/levels',
      name: 'levels',
      component: LevelsView
    },
    {
      path: '/playground',
      name: 'playground',
      component: PlaygroundView
    }
  ],
})

export default router
